<?php

namespace System;
use Twig_Environment;
use Twig_AutoLoader;
use Twig_loader_FileSystem;

class Renderer {
	public static function render($templatePath, $data) {
		require_once ROOT_PATH . '/vendor/autoload.php';
		Twig_AutoLoader::register();
		$loader = new Twig_loader_FileSystem(array("Page/Base/", $templatePath));
		$twig = new Twig_Environment($loader);
		$template = $twig->loadTemplate('View.twig');
		return $template->render($data);
	}
}